package pers.archives.user.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.archives.common.constant.ControllerPath;
import pers.archives.common.entity.User;
import pers.archives.common.ov.common.CommonResponse;
import pers.archives.common.ov.common.ResponseCode;
import pers.archives.common.utils.UserUtil;

/* 操作用户访问层
 *@program:archives-parent
 *@author: 赵浩浩
 *@Time: 2020/9/23  20:47
 */
@Slf4j
@RestController
@RequestMapping(ControllerPath.USER_PATH)
public class UserController {

    /**
     * 获取 当前用户信息
     * @return
     */
    @PostMapping(ControllerPath.GET_ME)
    public CommonResponse<User> getMyInfo() {
        System.out.println("测试获取用户信息");
        return new CommonResponse<User>(ResponseCode.USER_GET_USER_INFO, UserUtil.getUser());
    }


}
